package com.jan.spring.myspring.controller;

import org.springframework.security.oauth.consumer.BaseProtectedResourceDetails;
import org.springframework.security.oauth.consumer.ProtectedResourceDetailsService;
import org.springframework.security.oauth.consumer.client.OAuthRestTemplate;
import org.springframework.security.oauth.consumer.filter.OAuthConsumerContextFilter;
import org.springframework.security.oauth.consumer.filter.OAuthConsumerProcessingFilter;
import org.springframework.security.oauth.provider.ConsumerDetails;
import org.springframework.security.oauth.provider.ConsumerDetailsService;
import org.springframework.security.oauth.provider.attributes.ConsumerSecurityConfig;
import org.springframework.security.oauth.provider.attributes.ConsumerSecurityVoter;
import org.springframework.security.oauth.provider.filter.AccessTokenProcessingFilter;
import org.springframework.security.oauth.provider.filter.ProtectedResourceProcessingFilter;
import org.springframework.security.oauth.provider.filter.UnauthenticatedRequestTokenProcessingFilter;
import org.springframework.security.oauth.provider.filter.UserAuthorizationProcessingFilter;
import org.springframework.security.oauth.provider.nonce.OAuthNonceServices;
import org.springframework.security.oauth.provider.token.OAuthProviderTokenServices;
import org.springframework.security.oauth.provider.verifier.OAuthVerifierServices;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
import org.springframework.web.servlet.DispatcherServlet;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.HandlerMapping;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.ViewResolver;

/************************************************************************
 Copyright (C) Unpublished Electronic Arts (EA) Software, Inc.
 All rights reserved. EA Software, Inc., Confidential and Proprietary.

 This software is subject to copyright protection
 under the laws of the Canada and other countries.

 Unless otherwise explicitly stated, this software is provided
 by Electronic Arts (EA).

 *************************************************************************/

/**
 * @author Jan.Wang
 *
 */
@Controller
public class MyController {

    @RequestMapping(value="/test", method=RequestMethod.GET)
    public void test(){
        //for oauth2
        /*System.out.println("=============test=============");
        ClientDetailsService cds = null;
        ClientDetails cd = cds.loadClientByClientId("clientId");
        AuthorizationServerTokenServices asts = null;

        //RandomValueTokenServices rvts = null;
        TokenStore ts = null;OAuth2AccessToken oa2at;
        AuthorizationEndpoint ae = null;
        TokenEndpoint te = null;
        //OAuth2ExceptionHandlerFilter o2ehf = null;
        //OAuth2ProtectedResourceFilter o2prf = null;
        AuthorizationCodeServices acs = null;
        //for client
        OAuth2ProtectedResourceDetailsService oprds = null;
        OAuth2ProtectedResourceDetails oprd = oprds.loadProtectedResourceDetailsById("id");
        //OAuth2ClientTokenServices octs = null;
        OAuth2ClientContext acc = null;
        OAuth2ClientContextFilter qccf = null;
        AccessTokenCache atc = null;atc.loadRememberedTokens(null, null);
        HttpServletRequest req = null;*/

        //for oauth
        ConsumerDetailsService cds = null;
        ConsumerDetails cd = cds.loadConsumerByConsumerKey("consumerKey");

        OAuthProviderTokenServices opts = null;
        UnauthenticatedRequestTokenProcessingFilter urtpf = null;
        UserAuthorizationProcessingFilter upf = null;
        AccessTokenProcessingFilter atpf = null;
        ProtectedResourceProcessingFilter prpf = null;

        OAuthNonceServices ons = null;

        //OAuthCallbackServices ocs = null;

        OAuthVerifierServices ovs = null;

        ConsumerSecurityConfig osc = null;

        ConsumerSecurityVoter csv = null;

        //for consumer
        ProtectedResourceDetailsService prds = null;
        BaseProtectedResourceDetails bprds = null;

        OAuthConsumerContextFilter occf = null;
        OAuthConsumerProcessingFilter ocpf = null;
        OAuthRestTemplate ort = null;

        //for spring mvc
        DispatcherServlet ds = null;
        HandlerMapping hm = null;

        HandlerInterceptor hi = null;

        ViewResolver vr = null;

        ModelAndView mav = null;

        WebApplicationContext wac = null;

        WebApplicationContextUtils.getWebApplicationContext(null);
    }
}
